From a333b3c77bc82d53331e1c4d29ecd329ed83189c Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Sat, 6 Feb 2021 10:51:41 -0700 Subject: [PATCH] further cleanups for Format class header. (#683) manual fix for typedef found by clang-tidy modernize-use-using clazy fixes for clazy-function-args-by-ref clang-tidy fix for modernize-use-default-member-init --- gui/format.h | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/gui/format.h b/gui/format.h index 4da1d5428..237740b76 100644 --- a/gui/format.h +++ b/gui/format.h @@ -31,7 +31,10 @@ class FormatOption { public: - typedef enum { + + /* Types */ + + enum optionType { OPTstring, OPTbool, OPTint, @@ -39,16 +42,18 @@ public: OPTfloat, OPTinFile, OPToutFile, - } optionType; + }; + + /* Special Member Functions */ FormatOption() = default; FormatOption(const QString& name, const QString& description, optionType type, - QVariant defaultValue = QVariant(), - QVariant minValue = QVariant(), - QVariant maxValue = QVariant(), - QString html = QString() + const QVariant& defaultValue = QVariant(), + const QVariant& minValue = QVariant(), + const QVariant& maxValue = QVariant(), + const QString& html = QString() ): name_(name), description_(description), @@ -67,6 +72,8 @@ public: } } + /* Member Functions */ + QString getName() const { return name_; @@ -100,7 +107,7 @@ public: return defaultValue_; } - void setValue(QVariant v) + void setValue(const QVariant& v) { value_ = v; } @@ -116,6 +123,9 @@ public: } private: + + /* Data Members */ + QString name_; QString description_; optionType type_{OPTbool}; @@ -132,6 +142,9 @@ private: class Format { public: + + /* Special Member Functions */ + Format() = default; Format(const QString& name, const QString& description, @@ -157,7 +170,7 @@ public: writeRoutes_(writeRoutes), fileFormat_(fileFormat), deviceFormat_(deviceFormat), - hidden_(false), + extensions_(extensions), inputOptions_(inputOptions), outputOptions_(outputOptions) @@ -165,6 +178,8 @@ public: (void)html; // suppress 'unused' warning. } + /* Member Functions */ + bool isReadWaypoints() const { return readWaypoints_; @@ -300,6 +315,9 @@ public: } private: + + /* Data Members */ + QString name_; QString description_; bool readWaypoints_{false}; -- 2.30.2